package com.cskaoyan.day01.link;

/**
 * @author stone
 * @date 2022/01/27 11:24
 */
public class DbLinkedDemo {

    public static void main(String[] args) {
        //ctrl + shift + v → 历史粘贴板
        DbNode node1 = new DbNode("红", null, null);
        DbNode node2 = new DbNode("橙", node1, null);
        DbNode node3 = new DbNode("黄", node2, null);
        DbNode node4 = new DbNode("绿", node3, null);

        //维护结点之间的关系
        //next
        node1.next = node2;
        node2.next = node3;
        node3.next = node4;
        //pre
        //node2.pre = node1;
        //node3.pre = node2;
        //node4.pre = node3;

        node4.next = node1;
        node1.pre = node4;
    }
}
